#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main(){
	double r1,p1,r2,p2,rea,vir;
	cin>>r1>>p1>>r2>>p2;
	rea=r1*r2*cos(p1+p2);
	vir=r1*r2*sin(p1+p2);
	if(rea>-0.005 && rea<0) rea=0;
	if(vir>=0){
		cout<<fixed<<setprecision(2)<<rea<<"+"<<vir<<"i"<<endl;
	}else if(-0.005<vir && vir<0){
		cout<<fixed<<setprecision(2)<<rea<<"+0.00i"<<endl;
	}else{
		cout<<fixed<<setprecision(2)<<rea<<vir<<"i"<<endl;
	}
	return 0;
} 
